Add skip option to per_file#211
Conversation
Szelethus
left a comment
There was a problem hiding this comment.
I think the most correct solution would be to make CodeChecker the single source of authority on how to do skipping. For instance, CodeChecker would-skip mytest.cpp --skip skipfile.txt could return 0/1. On the other hand... this is quite an established interface we are extremely unlikely to ever change.
@bruntib, can you throw in your two cents?
Szelethus
left a comment
There was a problem hiding this comment.
We had an intersting coversation WRT older CC versions. If we patch this CodeChecker-side, it would be more elegant and robust, and wouldn't need much (any?) bazel side changes. However, that would cement skip files not working for per-file analysis with older CC versions. We should consider this carefully.
d494901 to
50f5b0c
Compare
50f5b0c to
1bb58db
Compare
Szelethus
left a comment
There was a problem hiding this comment.
LGTM, just please tidy up the code and docs.
| compiled_analyzers = [ | ||
| (re.compile(rf"_{analyzer[0]}_.*\.plist$"), analyzer[1]) | ||
| for analyzer in ANALYZER_PLIST_PATHS | ||
| ] | ||
|
|
||
| for regex, target_file in compiled_analyzers: |
There was a problem hiding this comment.
Ugh, I see where you are going with this, but this is a little messy. Neither compiled_analyzers nor regex are terribly talkative. How about leaving the regex compilation in the loop?
There was a problem hiding this comment.
I would really prefer to leave the compilation out of the loop.
I do understand that regex compilation is still much faster than compilation, but just for readability dropping so much performance...
I tried to make the variables more talkative. Is this better?
Why:
There is no skipfile option for the per_file rule.
We should strive to solve this on the Bazel side, but in the meanwhile it is okay if we just create an empty plist file for skipped files.
What:
Addresses:
Fixes: #160